#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#define int long long 
#define x first 
#define y second 
using namespace std;
int f(string s)
{
    int cnt1 = 0;
    int cnt2 = 0;
    int cnt3 = 0;
    //int flag = 0;
    for(int i = 1; i < s.size(); i++)
    {
        if(isdigit(s[i])) cnt1 ++;
        else if((s[i] >= 'a' && s[i] <= 'z')||(s[i] >= 'A' && s[i] <= 'Z')) cnt2 ++;
        else cnt3++;
    }
    if(cnt1 == s.size() - 1) return  1;
    else if(cnt2 == s.size() - 1) return 2;
    else if(cnt3 == 0) return 3;
    else return 4;
}
void solve()
{
    string s;
    cin >> s;
    if(isdigit(s[0]) && f(s) == 2) cout << "special" << endl;
    else if(isalpha(s[0]) && f(s) == 1) cout << "standard" << endl;
    else if(isalpha(s[0]) && f(s) == 3) cout << "mix" << endl; 
    else cout << "invalid" << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t;
    cin >> t;
    while(t -- )  solve();
    return 0;
}